package view.views.dialogContentViews;

import java.awt.FlowLayout;
import java.util.ArrayList;

import javax.swing.BoxLayout;
import javax.swing.ButtonGroup;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JRadioButton;

import model.Constants;

public class ChooseOptionContentPanel extends JPanel {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private final ArrayList<JRadioButton> buttons = new ArrayList<JRadioButton>();

	public ChooseOptionContentPanel() {

		this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));

		JPanel titlePanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
		JLabel title = new JLabel(Constants.CHOOSEOPTION);
		titlePanel.add(title);

		JPanel content = new JPanel(titlePanel.getLayout());

		JPanel radioPanel = new JPanel();
		radioPanel.setLayout(new BoxLayout(radioPanel, BoxLayout.Y_AXIS));
		JRadioButton oneIpManual = new JRadioButton(Constants.OPTIONONEIP, true);
		buttons.add(oneIpManual);
		JRadioButton oneIpList = new JRadioButton(Constants.OPTIONTWOIPCHOOSE);
		buttons.add(oneIpList);
		JRadioButton moreIp = new JRadioButton(Constants.OPTIONTHREEIPS);
		buttons.add(moreIp);

		ButtonGroup group = new ButtonGroup();

		group.add(oneIpManual);
		group.add(oneIpList);
		group.add(moreIp);

		radioPanel.add(oneIpManual);
		radioPanel.add(oneIpList);
		radioPanel.add(moreIp);

		content.add(radioPanel);

		this.add(titlePanel);
		this.add(content);

	}

	public ArrayList<JRadioButton> getButtonList() {
		return buttons;
	}

}
